/**
 * 分析结果模块样式
 * 统一使用系统设计规范的颜色方案
 */

:root {
    /* 系统颜色变量 - 与base.html保持一致 */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    /* 统一的颜色值 */
    --primary-color: #667eea;
    --primary-dark: #5a67d8;
    --primary-light: #7c8ff0;
    --secondary-color: #764ba2;
    --success-color: #4facfe;
    --warning-color: #43e97b;
    --danger-color: #f5576c;

    /* 中性色调 */
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

/* 分析结果Tab样式 - 与AI分析功能保持一致 */
.analysis-tab {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    color: var(--slate-500);
    background: transparent;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.analysis-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s ease;
}

.analysis-tab:hover::before {
    left: 100%;
}

.analysis-tab:hover {
    background: rgba(102, 126, 234, 0.08);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.analysis-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
}

.analysis-tab.active i {
    animation: tabIconBounce 0.6s ease-out;
}

@keyframes tabIconBounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-3px);
    }
    80% {
        transform: translateY(-1px);
    }
}

/* 表格单元格文本截断样式 */
.truncate-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    vertical-align: middle;
    /* 添加悬停提示 */
    cursor: pointer;
    transition: all 0.2s ease;
}

/* 悬停时显示完整内容 */
.truncate-text:hover {
    position: relative;
    white-space: normal;
    overflow: visible;
    background: white;
    padding: 4px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 10;
    max-width: 400px;
    word-wrap: break-word;
    line-height: 1.4;
}

/* 表格样式优化 - 使用系统颜色变量 */
#resultsTableArea table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    table-layout: fixed; /* 保持固定布局 */
    width: 100%;
}

#resultsTableArea th {
    background: linear-gradient(135deg, var(--slate-50) 0%, var(--slate-100) 100%);
    border-bottom: 2px solid var(--slate-200);
    color: var(--slate-700);
    font-weight: 600;
    letter-spacing: 0.025em;
    padding: 12px 6px;
    text-align: left;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#resultsTableArea th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

#resultsTableArea td {
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    padding: 12px 6px;
    color: var(--slate-700);
    transition: all 0.2s ease;
    /* 确保单元格内容不会溢出 */
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* 支持truncate的单元格样式 - 允许自然换行，充分利用列宽 */
#resultsTableArea td.truncate-cell {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
    /* 确保内容填满整个单元格 */
    width: 100% !important;
    max-width: none !important;
    text-align: left !important;
    /* 强制内容填满可用空间 */
    display: block !important;
    box-sizing: border-box !important;
    /* 移除可能的内联样式干扰 */
    min-width: 0 !important;
    /* 确保样式优先级最高 */
    position: relative !important;
    float: none !important;
    clear: none !important;
    margin: 0 !important;
    padding: 12px 6px !important;
}

/* 额外的样式规则，确保样式被正确应用 */
#resultsTableArea td.truncate-cell > * {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
}

/* 调试样式 - 让我们能看到哪些单元格应用了truncate-cell */
#resultsTableArea td.truncate-cell {
    background-color: rgba(102, 126, 234, 0.05) !important;
}

/* 非truncate单元格的样式 */
#resultsTableArea td.no-truncate {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#resultsTableArea tr {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#resultsTableArea tr::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 0 3px 3px 0;
}

#resultsTableArea tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#resultsTableArea tr:hover::before {
    transform: scaleY(1);
}

#resultsTableArea tr:hover td {
    color: var(--slate-800);
}

/* 分页按钮样式 - 使用系统颜色变量 */
.page-btn {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    color: var(--slate-600);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.page-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.page-btn:active::before {
    width: 100px;
    height: 100px;
}

.page-btn:hover:not(.active):not(.disabled) {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
    z-index: 1;
}

.page-btn:active:not(.active):not(.disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.page-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    z-index: 1;
    transform: translateY(-1px);
}

.page-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--slate-100);
    color: var(--slate-400);
    transform: none;
    border-color: var(--slate-200);
}

.page-btn.disabled:hover {
    background: var(--slate-100);
    color: var(--slate-400);
    transform: none;
    box-shadow: none;
    border-color: var(--slate-200);
}

/* 分页区域样式优化 - 使用系统颜色变量 */
#resultsPagination {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--slate-200);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#resultsPagination::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    transition: left 0.6s ease;
}

#resultsPagination:hover::before {
    left: 100%;
}

#resultsPagination:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* 页面大小选择器样式 */
#pageSizeSelect {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--slate-700);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    min-width: 80px;
    font-weight: 500;
    position: relative;
}

#pageSizeSelect:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

#pageSizeSelect:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

#pageSizeSelect option {
    background: white;
    color: var(--slate-700);
    padding: 8px;
}

/* 分页信息文本样式 */
#resultsPagination .text-slate-700 {
    color: var(--slate-600);
    font-weight: 500;
    transition: color 0.2s ease;
}

#resultsPagination:hover .text-slate-700 {
    color: var(--slate-700);
}

#resultsPagination .font-medium {
    color: var(--slate-800);
    font-weight: 600;
}

/* 分页容器布局优化 */
#paginationContainer {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* 分页按钮间距优化 */
#paginationContainer .page-btn {
    margin: 0 2px;
}

/* 分页省略号样式 */
#paginationContainer span {
    color: #94a3b8;
    font-weight: 500;
    user-select: none;
    padding: 0 4px;
}

/* 分页按钮动画效果 */
.page-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-btn:hover:not(.active):not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.page-btn:active:not(.active):not(.disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

/* 按钮涟漪效果 */
.page-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.page-btn:active::before {
    width: 100px;
    height: 100px;
}

/* 统计卡片样式 */
#resultsTableContainer .bg-white {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#resultsTableContainer .bg-white:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* 加载动画 */
#resultsLoadingState .animate-spin {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态样式 */
#resultsEmptyState {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

#resultsEmptyState i {
    color: #94a3b8;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 详情模态框样式 */
#resultDetailModal {
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.5);
}

#resultDetailModal .bg-white {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 过滤器区域样式 - 修复下拉箭头重复问题 */
select {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* 为各个下拉框单独添加箭头样式 - 使用包装器方法 */
.filter-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.filter-select-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 14px;
    z-index: 1;
}

.filter-select-wrapper select {
    width: 100%;
    padding-right: 32px !important;
    position: relative;
    z-index: 2;
    background: transparent;
}

/* 确保过滤器包装器在移动端正确显示 */
@media (max-width: 768px) {
    .filter-select-wrapper {
        width: 100%;
    }

    .filter-select-wrapper::after {
        right: 8px;
        font-size: 12px;
    }

    .filter-select-wrapper select {
        padding-right: 28px !important;
        font-size: 0.875rem;
    }
}

/* 优化过滤器包装器的hover和focus状态 */
.filter-select-wrapper:hover::after {
    color: var(--primary-color);
}

.filter-select-wrapper:focus-within::after {
    color: var(--primary-color);
}

/* 响应式设计 - 优化移动端体验 */
@media (max-width: 1024px) {
    /* 平板端优化 */
    .grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .analysis-tab {
        font-size: 0.9rem;
        padding: 0.75rem 0.75rem;
    }

    .analysis-tab i {
        margin-right: 0.5rem;
    }
}

@media (max-width: 768px) {
    /* 移动端优化 */
    .grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .text-3xl {
        font-size: 1.5rem;
    }

    .stat-card .w-14 {
        width: 3rem;
        height: 3rem;
    }

    .stat-card .text-xl {
        font-size: 1rem;
    }

    /* 标签页优化 */
    .analysis-tab {
        font-size: 0.8rem;
        padding: 0.5rem 0.25rem;
        border-radius: 6px;
    }

    .analysis-tab i {
        margin-right: 0.25rem;
        font-size: 0.9rem;
    }

    .analysis-tab span {
        display: none; /* 在小屏幕上隐藏文本 */
    }

    /* 查询条件区域优化 */
    .grid-cols-1.md\\:grid-cols-5 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    /* 表格优化 */
    #resultsTableArea {
        overflow-x: auto;
        border-radius: 8px;
    }

    #resultsTableArea table {
        min-width: 600px;
        font-size: 0.875rem;
    }

    #resultsTableArea th, #resultsTableArea td {
        padding: 12px 8px;
        font-size: 0.8rem;
    }

    #resultsTableArea th {
        font-size: 0.75rem;
        letter-spacing: 0.01em;
    }

    /* 分页优化 */
    #resultsPagination {
        padding: 0.75rem;
        border-radius: 8px;
    }

    #resultsPagination .flex {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
    }

    #resultsPagination .flex.items-center {
        justify-content: center;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* 分页按钮移动端适配 */
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.875rem;
        padding: 0 6px;
        margin: 0 1px;
    }

    /* 页面大小选择器移动端样式 */
    #pageSizeSelect {
        min-width: 80px;
        font-size: 0.875rem;
        padding: 6px 8px;
    }

    /* 分页按钮容器移动端优化 */
    #paginationContainer {
        justify-content: center;
        flex-wrap: wrap;
        gap: 2px;
        max-width: 100%;
    }

    /* 分页信息文本移动端优化 */
    #resultsPagination .text-sm {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    #resultsPagination .text-slate-700 {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    /* 按钮优化 */
    #exportResultsBtn, #refreshResultsBtn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    /* 输入框优化 */
    input, select {
        padding: 8px 12px;
        font-size: 0.875rem;
    }

    #searchInput {
        padding-left: 36px;
        background-size: 16px;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
        border-radius: 8px;
    }

    .stat-card .text-3xl {
        font-size: 1.25rem;
    }

    .stat-card .w-14 {
        width: 2.5rem;
        height: 2.5rem;
    }

    .stat-card .text-xl {
        font-size: 0.875rem;
    }

    /* 查询条件区域 */
    .space-y-4 > * {
        margin-bottom: 0.5rem;
    }

    /* 标签页容器 */
    .flex.space-x-1 {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .analysis-tab {
        min-width: 60px;
        padding: 0.5rem 0.25rem;
        justify-content: center;
    }

    /* 表格进一步优化 */
    #resultsTableArea table {
        min-width: 500px;
        font-size: 0.8rem;
    }

    #resultsTableArea th, #resultsTableArea td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    #resultsTableArea th {
        font-size: 0.7rem;
        white-space: nowrap;
    }

    /* 分页进一步优化 */
    #resultsPagination {
        padding: 0.5rem;
    }

    #resultsPagination .flex {
        gap: 0.75rem;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        font-size: 0.75rem;
        padding: 0 4px;
        margin: 0 1px;
    }

    #pageSizeSelect {
        min-width: 70px;
        font-size: 0.8rem;
        padding: 4px 6px;
    }

    /* 在超小屏幕上简化分页信息 */
    #resultsPagination .text-slate-700 {
        font-size: 0.7rem;
        line-height: 1.2;
    }

    #resultsPagination .font-medium {
        font-size: 0.8rem;
    }

    /* 隐藏部分文本以节省空间 */
    .analysis-tab span {
        display: none;
    }

    /* 模态框优化 */
    #resultDetailModal .max-w-4xl {
        margin: 0.5rem;
        max-height: calc(100vh - 1rem);
        border-radius: 12px;
    }

    #resultDetailModal .p-6 {
        padding: 1rem;
    }

    #resultDetailModal .text-xl {
        font-size: 1.125rem;
    }

    /* 按钮进一步优化 */
    #exportResultsBtn, #refreshResultsBtn {
        padding: 8px 12px;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    /* 输入框进一步优化 */
    input, select {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    #searchInput {
        padding-left: 32px;
        background-size: 14px;
    }
}

@media (max-width: 320px) {
    /* 极小屏幕优化 */
    .stat-card .text-3xl {
        font-size: 1rem;
    }

    .stat-card .w-14 {
        width: 2rem;
        height: 2rem;
    }

    .stat-card .text-xl {
        font-size: 0.75rem;
    }

    .analysis-tab {
        min-width: 50px;
        padding: 0.4rem 0.2rem;
    }

    .page-btn {
        min-width: 24px;
        height: 24px;
        font-size: 0.7rem;
        padding: 0 2px;
    }

    #resultsPagination .text-slate-700 {
        font-size: 0.65rem;
    }

    #pageSizeSelect {
        min-width: 60px;
        font-size: 0.75rem;
        padding: 3px 5px;
    }
}

/* 深色模式支持 - 使用CSS变量确保一致性 */
@media (prefers-color-scheme: dark) {
    :root {
        /* 深色模式变量 */
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #e2e8f0;
        --text-tertiary: #cbd5e1;
        --border-color: #334155;
        --hover-bg: rgba(99, 102, 241, 0.1);
    }

    body {
        background: var(--bg-primary);
        color: var(--text-primary);
    }

    .analysis-tab {
        color: var(--text-tertiary);
        background: transparent;
    }

    .analysis-tab:hover {
        background: var(--hover-bg);
        color: var(--text-secondary);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
    }

    .analysis-tab.active {
        background: var(--primary-gradient);
        color: white;
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    }

    /* 查询条件区域 */
    .bg-white {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    .border-slate-200 {
        border-color: var(--border-color) !important;
    }

    .text-slate-600, .text-slate-700, .text-slate-800 {
        color: var(--text-secondary) !important;
    }

    .text-slate-500 {
        color: var(--text-tertiary) !important;
    }

    /* 表格样式 */
    #resultsTableArea {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    #resultsTableArea table {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    #resultsTableArea th {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
        border-bottom: 2px solid var(--border-color);
        color: var(--text-secondary);
    }

    #resultsTableArea td {
        border-bottom: 1px solid var(--border-color);
        color: var(--text-tertiary);
    }

    #resultsTableArea tr:hover {
        background: var(--hover-bg);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    }

    #resultsTableArea tr:hover td {
        color: var(--text-secondary);
    }

    /* 分页样式 */
    #resultsPagination {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    .page-btn {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-tertiary);
    }

    .page-btn:hover:not(.active):not(.disabled) {
        background: var(--primary-gradient);
        color: white;
        border-color: transparent;
    }

    .page-btn.active {
        background: var(--primary-gradient);
        color: white;
        border-color: transparent;
    }

    .page-btn.disabled {
        background: var(--bg-secondary);
        color: var(--text-tertiary);
        border-color: var(--border-color);
        opacity: 0.5;
    }

    /* 页面大小选择器 */
    #pageSizeSelect {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-secondary);
    }

    #pageSizeSelect:hover {
        border-color: var(--primary-color);
        background: var(--bg-secondary);
    }

    #pageSizeSelect option {
        background: var(--bg-secondary);
        color: var(--text-secondary);
    }

    /* 统计卡片 */
    .stat-card {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    /* 模态框 */
    #resultDetailModal .bg-white {
        background: var(--bg-secondary) !important;
        border-color: var(--border-color) !important;
        color: var(--text-primary) !important;
    }

    /* 输入框和选择器 */
    input, select {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-secondary);
    }

    input:focus, select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    }

    /* 按钮 */
    button {
        background: var(--bg-tertiary);
        border-color: var(--border-color);
        color: var(--text-secondary);
    }

    button:hover {
        background: var(--hover-bg);
        color: var(--text-primary);
    }

    /* 加载状态 */
    #resultsLoadingState {
        background: var(--bg-secondary);
        color: var(--text-secondary);
    }

    #resultsEmptyState {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }

    #resultsEmptyState i {
        color: var(--text-tertiary);
    }

    #resultsEmptyState p {
        color: var(--text-tertiary);
    }
}

/* 自定义滚动条 */
#resultsTableArea::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#resultsTableArea::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

#resultsTableArea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

#resultsTableArea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 按钮动画和交互反馈 */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    cursor: pointer;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 导出和刷新按钮优化 */
#exportResultsBtn, #refreshResultsBtn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 24px;
    font-weight: 600;
    letter-spacing: 0.025em;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

#exportResultsBtn:hover, #refreshResultsBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

#refreshResultsBtn {
    background: var(--slate-100);
    color: var(--slate-700);
    border: 1px solid var(--slate-200);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#refreshResultsBtn:hover {
    background: var(--slate-200);
    color: var(--slate-800);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 重置按钮优化 */
#resetFiltersBtn {
    background: var(--slate-50);
    color: var(--slate-600);
    border: 1px solid var(--slate-200);
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#resetFiltersBtn:hover {
    background: var(--slate-100);
    color: var(--slate-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 输入框和选择器交互效果 */
input, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    border: 1px solid var(--slate-200);
    background: var(--slate-50);
    color: var(--slate-700);
    padding: 10px 14px;
    font-size: 14px;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
    transform: translateY(-1px);
}

input:hover, select:hover {
    border-color: var(--slate-300);
    background: white;
}

/* 搜索框特殊样式 - 修复图标重复问题，移除CSS背景图标 */
#searchInput {
    padding-left: 42px;
    /* 移除背景图标，使用HTML中的Font Awesome图标 */
}

/* 数据加载骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 特殊效果 */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.stat-card:hover::before {
    animation: shine 0.6s ease-in-out;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* 图标动画 */
.analysis-tab i {
    transition: all 0.3s ease;
}

.analysis-tab:hover i {
    transform: scale(1.1);
}

.analysis-tab.active i {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-5px);
    }
    80% {
        transform: translateY(-3px);
    }
}

/* 表格行悬停效果 */
#resultsTableBody tr {
    position: relative;
    transition: all 0.2s ease;
}

#resultsTableBody tr::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

#resultsTableBody tr:hover::after {
    transform: scaleY(1);
}

/* 工具提示样式 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    margin-bottom: 0.5rem;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 加载状态优化 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 错误状态样式 */
.error-state {
    text-align: center;
    padding: 3rem;
    color: #ef4444;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 成功状态样式 */
.success-state {
    text-align: center;
    padding: 3rem;
    color: #10b981;
}

.success-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: success-bounce 0.6s ease-in-out;
}

@keyframes success-bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

/* 额外的UI细节优化 */

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 优化高DPI下的边框和阴影 */
    .stat-card, #resultsPagination, #resultDetailModal .bg-white {
        border-width: 0.5px;
    }

    /* 优化图标清晰度 */
    .analysis-tab i, .stat-card i {
        transform: scale(1.1);
    }
}

/* 无障碍访问性优化 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 键盘导航优化 */
button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 跳过导航链接 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 0 0 4px 0;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .analysis-tab {
        border: 2px solid var(--slate-300);
    }

    .analysis-tab:hover {
        border-color: var(--primary-color);
    }

    .analysis-tab.active {
        border-color: var(--primary-color);
    }

    .page-btn {
        border: 2px solid var(--slate-300);
    }

    .page-btn:hover {
        border-color: var(--primary-color);
    }

    .page-btn.active {
        border-color: var(--primary-color);
    }

    #resultsTableArea th {
        border-bottom: 3px solid var(--slate-300);
    }

    #resultsTableArea td {
        border-bottom: 2px solid var(--slate-200);
    }
}

/* 打印样式优化 */
@media print {
    /* 隐藏不需要打印的元素 */
    .analysis-tab, #exportResultsBtn, #refreshResultsBtn, #resetFiltersBtn,
    #resultsPagination, #resultDetailModal, .hidden-print {
        display: none !important;
    }

    /* 打印友好的样式 */
    body {
        background: white !important;
        color: black !important;
    }

    .stat-card, #resultsTableArea, .bg-white {
        background: white !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        break-inside: avoid;
    }

    #resultsTableArea table {
        font-size: 12px;
    }

    #resultsTableArea th, #resultsTableArea td {
        border-bottom: 1px solid #ccc !important;
        padding: 8px !important;
    }

    /* 确保表格不被分割 */
    #resultsTableArea table {
        page-break-inside: avoid;
    }

    /* 调整统计卡片布局 */
    .grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
}

/* 全局滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--slate-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

::-webkit-scrollbar-corner {
    background: var(--slate-100);
}

/* 深色模式滚动条 */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--text-tertiary);
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-secondary);
    }

    ::-webkit-scrollbar-corner {
        background: var(--bg-tertiary);
    }
}

/* 加载状态动画优化 */
.loading-shimmer {
    background: linear-gradient(90deg,
        var(--slate-100) 25%,
        var(--slate-200) 50%,
        var(--slate-100) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 错误状态优化 */
.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #f87171;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: errorSlideIn 0.3s ease-out;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功状态优化 */
.success-message {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #4ade80;
    color: #166534;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: successSlideIn 0.3s ease-out;
}

@keyframes successSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}